package cate.common.table.activity.turntable.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.turntable.row.TurnTableRewardPoolRow;
import cate.common.util.random.RWList;

import java.util.ArrayList;
import java.util.List;

public class TurnTableRewardPoolSheet extends ESheet<TurnTableRewardPoolRow> {
    @Override
    public String getSheetName() {
        return "奖池配置";
    }

    public RWList<TurnTableRewardPoolRow> getRewardRWList(int group) {
        RWList<TurnTableRewardPoolRow> rwList = new RWList<>();
        for (TurnTableRewardPoolRow item :
                list) {
            if (item.group == group) {
                rwList.add(item);
            }
        }
        return rwList;
    }

    public List<TurnTableRewardPoolRow> getListByConfigId(int configId) {
        List<TurnTableRewardPoolRow> rwList = new ArrayList<>();
        for (TurnTableRewardPoolRow item :
                list) {
            if (item.configId == configId) {
                rwList.add(item);
            }
        }
        return rwList;
    }

    public List<TurnTableRewardPoolRow> getRewardList(int group, int configId) {
        List<TurnTableRewardPoolRow> rwList = new ArrayList<>();
        for (TurnTableRewardPoolRow item :
                list) {
            if (item.group == group && item.configId == configId) {
                rwList.add(item);
            }
        }
        return rwList;
    }
}
